package com.gitee.feizns.itrip.personal.biz.controller;

import com.gitee.feizns.itrip.personal.beans.dto.Dto;
import com.gitee.feizns.itrip.personal.biz.entity.vo.ForViewGetImg;
import com.gitee.feizns.itrip.personal.biz.entity.vo.ForViewGetVideoDesc;
import com.gitee.feizns.itrip.personal.biz.entity.vo.ForViewHotelLable;
import com.gitee.feizns.itrip.personal.biz.entity.vo.ForViewQueryHotelDetails;
import com.gitee.feizns.itrip.personal.biz.entity.vo.ForViewQueryTradeArea;
import com.gitee.feizns.itrip.personal.biz.service.HotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author feizns
 * @since 2019/1/8 0008
 */
@RequestMapping("/api/hotel")
@RestController
public class HotelController {

    /**
     * 酒店信息获取失败
     */
    private static final String GET_HOTEL_INFO_FAIL = "100214";

    @Autowired
    private HotelService hotelService;

    @GetMapping("/getimg/{hotelId}")
    public Dto<List<ForViewGetImg>> getImg(@PathVariable Integer hotelId) {
        return Dto.getSuccessDto("获取酒店图片成功", hotelService.getImage(hotelId));
    }
    
    @GetMapping("/queryhotcity/{isChina}")
    public Dto<List<ForViewQueryTradeArea>> hotelQueryHotCity(@PathVariable Integer isChina) {
        return Dto.getSuccessDto(null, hotelService.queryHotCity(isChina));
    }
    
    @GetMapping("/querytradearea/{parent}")
    public Dto<List<ForViewQueryTradeArea>> queryTradeArea(@PathVariable Integer parent) {
            return Dto.getSuccessDto(null, hotelService.queryTradeArea(parent));
    }
    
    @GetMapping("/getvideodesc/{hotelId}")
    public Dto<ForViewGetVideoDesc> getVideoDesc(@PathVariable Integer hotelId) {
        return Dto.getSuccessDto("获取酒店视频文字描述成功", hotelService.getVideoDesc(hotelId));
    }
    
    @GetMapping("/queryhoteldetails/{hotelId}")
    public Dto<List<ForViewQueryHotelDetails>> queryHotelDetails(@PathVariable Integer hotelId) {
        return Dto.getSuccessDto(null, hotelService.queryHotelDetails(hotelId));
    }
    
    @GetMapping("/queryhotelfacilities/{hotelId}")
    public Dto<String> queryHotelFacilities(@PathVariable Integer hotelId) {
        return Dto.getSuccessDto(null, hotelService.queryHotelFacilities(hotelId));
    }

    @GetMapping("/queryhotelpolicy/{hotelId}")
    public Dto<String> queryHotelPolicy(@PathVariable Integer hotelId) {
        return Dto.getSuccessDto(null, hotelService.queryHotelPolicy(hotelId));
    }

    @GetMapping("/queryhotelfeature")
    public Dto<List<ForViewHotelLable>> queryHotelFeature() {
        return Dto.getSuccessDto(null, hotelService.queryHotelFeature());
    }

}